package codeOfChapter04;

import java.io.File;
import java.util.List;

public class TableProcessor implements IProcessor {
	@Override
	public String process(String url) throws Exception {
		List<File> classFiles = Scanner.getClassFiles(url);
		StringBuilder sb = new StringBuilder();
		for (File file : classFiles) {
			Class<?> clazz = ClassFileLoader.loadClass(file);
			TableInfo table = TableInfo.parse(clazz);
			if (table != null) {
				sb.append(table.toString());
			}
		}
		return sb.toString();
	}
}
